package com.ruoyi.resume.task;

import com.ruoyi.resume.enums.TaskType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Task {
    private TaskType type;   // 任务类型：如 "DELETE_TAG" 或 "UPDATE_CATEGORIES"
    private Integer param; // 通用参数，例如 tagId 或 categoryId

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Task task = (Task) o;
        return Objects.equals(type, task.type) && Objects.equals(param, task.param);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, param);
    }
}

